import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lishuo
 * Date: 2024-04-07
 * Time: 23:00
 */
public class StructDemo {
    public static void main(String[] args) {
        //创建一个集合，存储多个字符串元素
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"张无忌,15","周芷若,14","赵敏,13","张三丰,100","谢广坤,41");

        // 将上述字符串封装成 Actor 对象返回
        List<Actor> collect = list.stream().map(Actor::new).collect(Collectors.toList());
        System.out.println(collect);
    }
}
